package com.crm.entity;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="supinvoice")
public class SupplierInvoice implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")
	private int id;
	
	@Column(name="enqid")
	private int enqId;
	
	@Column(name="sup_id")
	private int supplierId;
	
	@Column(name="part_id")
	private int partId;
	
	private int qty;
	
	private float price;
	
	@Column(name="invoice_num")
	private String invoiceNum;
	
	private Date date;

	@ManyToOne
	@JoinColumn(name="BUSINESS_ID")
	private Business businessId;
	
 @Column(name="suppliercopy")
	private byte[] suppliercopy;
 
	
	public byte[] getSuppliercopy() {
	return suppliercopy;
}

public void setSuppliercopy(byte[] suppliercopy) {
	this.suppliercopy = suppliercopy;
}

	public Business getBusinessId() {
		return businessId;
	}

	public void setBusinessId(Business businessId) {
		this.businessId = businessId;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getEnqId() {
		return enqId;
	}

	public void setEnqId(int enqId) {
		this.enqId = enqId;
	}

	public int getPartId() {
		return partId;
	}

	public void setPartId(int partId) {
		this.partId = partId;
	}

	public int getQty() {
		return qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public String getInvoiceNum() {
		return invoiceNum;
	}

	public void setInvoiceNum(String invoiceNum) {
		this.invoiceNum = invoiceNum;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public int getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(int supplierId) {
		this.supplierId = supplierId;
	}
	public SupplierInvoice(Business bus, int enqid, int supplierId, byte[] supplierCopy, String invoiceNum, Date date){
		this.businessId=bus;
		this.enqId=enqid;
		this.supplierId=supplierId;
		this.suppliercopy=supplierCopy;
		this.invoiceNum=invoiceNum;
		this.date=date;
	}
	public SupplierInvoice(){
		
	}
}
